package com.bill.common.user.dto;

import java.text.SimpleDateFormat;

import com.bill.common.user.entity.RegisterCode;
import com.sinba.common.dto.BaseDTO;

public class RegisterCodeDTO extends BaseDTO{
	private long id;
	private Long userId;	//用户ID
	private String loginName;	//用户账号
	private String code;
	private String status;	//状态：未使用、已使用、已禁用（未使用）
	private String useTime;	//使用时间
	private String token;	//凭证
	private String remark;
	private String createTime;//创建时间
	private String angle;	//角度
	private String msg;		//提示信息
	
	public static void entity2dto(RegisterCode code, RegisterCodeDTO dto) {
		dto.setCode(code.getCode());
		dto.setLoginName(code.getLoginName());
		dto.setId(code.getId());
		dto.setToken(code.getToken());
		dto.setRemark(code.getRemark());
		if(code.getCreateTime() != null)
		dto.setCreateTime(new SimpleDateFormat("yyyy年MM月dd日 hh时mm分ss秒").format(code.getCreateTime()));
		if(code.getUseTime() != null)
		dto.setUseTime(new SimpleDateFormat("yyyy年MM月dd日 hh时mm分ss秒").format(code.getUseTime()));
		dto.setStatus(code.getStatus());
	}
	
	public String getAngle() {
		return angle;
	}

	public void setAngle(String angle) {
		this.angle = angle;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public Long getUserId() {
		return userId;
	}
	public void setUserId(Long userId) {
		this.userId = userId;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getUseTime() {
		return useTime;
	}
	public void setUseTime(String useTime) {
		this.useTime = useTime;
	}
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
}	
